package org.bigjava.user.web.controller;

import org.bigjava.bean.Notice;
import org.bigjava.user.service.impl.AdminServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/admin/")
public class AdminController {

    @Autowired
    AdminServiceImpl adminService;

    @RequestMapping("addnotice")
    public void addnotice(@RequestParam("adminid") long id, Notice notice){
        adminService.insertNotice(notice);
    }

    @RequestMapping("updatenoticestate")
    public void updateNoticeState(@RequestParam("state")long state,@RequestParam("id")long id){
        adminService.updateNoticeState(state,id);
    }

    @RequestMapping("updateuserstate")
    public void updateUserState(@RequestParam("state")long state,@RequestParam("id")long id){
        adminService.updateUserState(state,id);
    }

    @RequestMapping("updateuserhead")
    public void updateUserHead(@RequestParam("userId")long userId){
        //修改用户头像为默认头像
        adminService.updateUserHead(userId);
    }

    @RequestMapping("updatepetname")
    public void updatePetName(@RequestParam("userId")long userId){
        //修改用户昵称为违规昵称
        adminService.updatePetName(userId);
    }




}
